#include<bits/stdc++.h>

#define int long long
#define maxn 500005

using namespace std;

inline int read(){
    int lre=0,f=1;
    char c=getchar();
    while(c<'0'||c>'9'){
        if(c=='-'){
            f=-1;
        }
        c=getchar();
    }
    while(c>='0'&&c<='9'){
        lre=(lre<<3)+(lre<<1)+(c-'0');
        c=getchar();
    }
    return lre*f;
}

int n,res;
int arr[maxn];

int m;
int cnt[maxn],brr[maxn];

signed main(){

    freopen("duel.in","r",stdin);
    freopen("duel.out","w",stdout);

    n=read();
    for(int i=1;i<=n;i++){
        arr[i]=read();
    }
    sort(arr+1,arr+n+1);
    for(int i=1;i<=n;i++){
        brr[i]=arr[i];
    }
    m=unique(brr+1,brr+n+1)-brr-1;
    int it=1;
    for(int i=1;i<=n;i++){
        while(it<=m&&brr[it]<arr[i])it++;
        cnt[it]++;
    }
    int lst=0,res=0;//res is the killed
    for(int i=1;i<=m;i++){
        res+=min(lst,cnt[i]);
        lst+=max(0ll,cnt[i]-lst);
    }
    printf("%lld\n",n-res);

    return 0;
}
/*
10
136 136 136 2417 136 136 2417 136 136 136
*/
